import request from '@/utils/request'

// 查询计划列表
export function listPlan(query) {
  return request({
    url: '/purchase/plan/list',
    method: 'get',
    params: query
  })
}

// 查询计划详细
export function getPlan(planId) {
  return request({
    url: '/purchase/plan/' + planId,
    method: 'get'
  })
}

// 新增计划
export function addPlan(data) {
  return request({
    url: '/purchase/plan',
    method: 'post',
    data: data
  })
}

// 修改计划
export function updatePlan(data) {
  return request({
    url: '/purchase/plan',
    method: 'put',
    data: data
  })
}

// 删除计划
export function delPlan(planId) {
  return request({
    url: '/purchase/plan/' + planId,
    method: 'delete'
  })
}

// 提交计划
export function commitPlan(data) {
  return request({
    url: '/purchase/plan/commit',
    method: 'post',
    data: data
  })
}

// 撤回计划
export function recallPlan(data) {
  return request({
    url: '/purchase/plan/recall',
    method: 'post',
    data: data
  })
}

// 审批计划
export function approvePlan(data) {
  return request({
    url: '/purchase/plan/approve',
    method: 'post',
    data: data
  })
}

// 弃审
export function unapprovePlan(data) {
  return request({
    url: '/purchase/plan/unapprove',
    method: 'post',
    data: data
  })
}
